﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <!-- CLIENT COMMAND STRUCTURE  SCHEMA VERSION 1.0-->


  <!-- Templates for types and restrictions -->
  <xs:complexType name="ParamsTemplate">
    <xs:attribute name="Order" type="xs:int" use ="required">
      <xs:annotation>
        <xs:documentation></xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="ParamSwitch" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation></xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="ParamValue" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation></xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="ParamType" type="ParamTypes" use="required">
      <xs:annotation>
        <xs:documentation></xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:simpleType name="ParamTypes">
    <xs:restriction base="xs:string">
      <xs:enumeration value="String">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Filename">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="TSVariable">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="VariableFile">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Password">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="None">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="VarTypes">
    <xs:restriction base="xs:string">
      <xs:enumeration value="TaskSequenceEnvironment">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SystemEnvironment">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="UserEnvironment">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="VariableFile">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Password">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="None">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="Providers">
    <xs:restriction base="xs:string">
      <xs:enumeration value="SmbFileTransfer">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="WindowTypes">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Hidden">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Minimized">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Normal">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Maximized">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  
  <xs:simpleType name="ResultTypes">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Success">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Failure">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Reboot">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Other">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="ResultCodeTemplate">
    <xs:attribute name="Code" use="required" type="xs:integer">
      <xs:annotation>
        <xs:documentation></xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="TranslatedCode" use="optional" type="xs:integer">
      <xs:annotation>
        <xs:documentation></xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="Description" use="optional" type="xs:string">
      <xs:annotation>
        <xs:documentation></xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="ResultType" use="required" type="ResultTypes">
      <xs:annotation>
        <xs:documentation></xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:complexType name="ReturnFileTemplate">
    <xs:attribute name="FileName" type="xs:string" use="required">
      <xs:annotation>
        <xs:documentation></xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="CopyMethod" type="Providers" use="required">
      <xs:annotation>
        <xs:documentation></xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="CopyFrom" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation></xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="CopyTo" type="xs:string" use="required">
      <xs:annotation>
        <xs:documentation></xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>


  <xs:simpleType name="CommandTypes">
    <xs:restriction base="xs:string">
      <xs:enumeration value="EXE">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="VBScript">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PowerShell">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CMDorBAT">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  
  
  

  <xs:complexType name="TaskTemplate">
    <xs:sequence>
      <xs:choice maxOccurs="unbounded">
        <xs:element name="Parameter" minOccurs="0" maxOccurs="unbounded" type="ParamsTemplate">
          <xs:annotation>
            <xs:documentation></xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="ResultCodes" minOccurs="1" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation></xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:element name="ResultCode" minOccurs="1" maxOccurs="unbounded" type="ResultCodeTemplate">
                <xs:annotation>
                  <xs:documentation></xs:documentation>
                </xs:annotation>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="SetEnvironmentVariable" minOccurs="1" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation></xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:attribute name="VarName" use="required" type="xs:string">
              <xs:annotation>
                <xs:documentation></xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="VarValue" use="optional" type="xs:string">
              <xs:annotation>
                <xs:documentation></xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="VarType" use="optional" type="xs:string">
              <xs:annotation>
                <xs:documentation></xs:documentation>
              </xs:annotation>
            </xs:attribute>
          </xs:complexType>
        </xs:element>
        <xs:element name="ReturnFile" minOccurs="0" maxOccurs="unbounded" type="ReturnFileTemplate">
          <xs:annotation>
            <xs:documentation></xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:choice>
    </xs:sequence>
    <xs:attribute name="Order" type="xs:int" use="required">
      <xs:annotation>
        <xs:documentation></xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="StepName" type ="xs:string" use ="optional">
      <xs:annotation>
        <xs:documentation></xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="Executable" type="xs:string" use="required">
      <xs:annotation>
        <xs:documentation></xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="CommandType" type="CommandTypes" use="optional">
      <xs:annotation>
        <xs:documentation></xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="WorkingDirectory" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation></xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="RunAsUser" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation></xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="RunAsPassword" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation></xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="RunWindow" type="WindowTypes" use="optional">
      <xs:annotation>
        <xs:documentation></xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>
  
  <!-- Main part of schema -->
  <xs:element name="ClientTaskFile">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="1" name="PreConfigurationTasks">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="1" maxOccurs="unbounded" name="Task" type="TaskTemplate" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" maxOccurs="1" name="ConfigurationTask">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="1" maxOccurs="1" name="Task" type="TaskTemplate" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" maxOccurs="1" name="PostConfigurationTasks">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="1" maxOccurs="unbounded" name="Task" type="TaskTemplate" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="SchemaVersion" use="required" type="xs:string">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="Created" use="required" type="xs:dateTime">
        <xs:annotation>
          <xs:documentation></xs:documentation>
        </xs:annotation>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
</xs:schema>